import java.sql.*;

public class App2 {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        Class.forName("com.mysql.jdbc.Driver");
        String url = "jdbc:mysql://localhost:3306/test?useSSL=false";
        String name="root";
        String password="yangxiaocheng3";
        Connection connection = DriverManager.getConnection(url, name, password);
        Statement statement = connection.createStatement();
        String sql = "SELECT `id` ,`username`,`passward` from `user`";
        ResultSet set = statement.executeQuery(sql);
        while (set.next()){
            String v = set.getString(2);
            String a = set.getString(1);
            System.out.println("id is "+ a  +   "  username is "+v);
        }
//        boolean next = set.next();
//        System.out.println(next);
//        set.getString(2);


    }
}
